﻿<pages:BasePage
    x:Class="TheVerge.Phone.Pages.ArticlesPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:con="clr-namespace:TheVerge.Phone.Controls"
    xmlns:pages="clr-namespace:TheVerge.Phone.Pages"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    <pages:BasePage.Resources>
        <Style TargetType="Button" BasedOn="{StaticResource clearButtonStyle}" />
    </pages:BasePage.Resources>

    <Grid x:Name="articlesRoot" Background="{StaticResource PhoneBackgroundBrush}" Margin="-1">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <con:HeaderControl />
        
        <con:InfiniteScroller Grid.Row="1" Margin="12,0">
            <con:InfiniteScroller.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <ContentControl ContentTemplate="{StaticResource articleItemWithImageTemplate}" Content="{Binding}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"  />
                        <Button Click="Article_Click" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                    </Grid>
                </DataTemplate>
            </con:InfiniteScroller.ItemTemplate>
        </con:InfiniteScroller> 

        <con:ArticleEntryControl x:Name="aec" Grid.RowSpan="2" />
    </Grid>
</pages:BasePage>